<{include file="public/header.html"}>
		<div class="xinsu-right">
			<div class="xinsu-right-content">
				<div class="xinsu-data-content">
					<div class="xinsu-title">
						<span class="layui-breadcrumb">
							<a href="/">当前位置</a>
							<a href="/<{$common_info.module}>/LogAtm/"><cite>充值记录表管理</cite></a>
						</span>
					</div>
					
					<form class="layui-form xinsu-form" action="/<{$common_info.module}>/LogAtm/" method="get">
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label xinsu-form-label">代理：</label>
								<div class="layui-input-inline xinsu-input-inline">
									<select name="aid">
										<option value="0" <{if $aid=="0"}>selected="selected"<{/if}>>全部</option>
										<{foreach $agent as $key to $val}>
										<option value="<{$val.id}>" <{if $aid==$val.id}>selected="selected"<{/if}>><{$val.agent_name}></option>
										<{/foreach}>
									</select>
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label xinsu-form-label">用户:</label>
								<div class="layui-input-inline xinsu-input-inline">
									<input type="text" name="username" class="layui-input" value="<{if $username !='0'}><{urldecode($username)}><{/if}>" />
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label xinsu-form-label">申请时间:</label>
								<div class="layui-input-inline xinsu-input-inline">
									<input type="text" name="start_time" id="start_time" lay-verify="date"  autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})" value="<{if 0 != $start_time}><{$start_time}><{/if}>">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label xinsu-form-label">~</label>
								<div class="layui-input-inline xinsu-input-inline">
									<input type="text" name="end_time" id="end_time" lay-verify="date"  autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})" value="<{if 0 != $end_time}><{$end_time}><{/if}>">
								</div>
							</div>

							<button class="layui-btn xinsu-btn">查询</button>
							<span>记录总数：共 <{$total}> 条</span>
						</div>
					</form>
					<div class="layui-form xinsu-form">
						<table class="layui-table">
							<thead>
								<tr>
									<th>ID</th>
									<th>用户</th>
									<th>充值时间</th>
									<th>撤销时间</th>
									<th>金额</th>
									<th>状态</th>
									<th>操作</th>
								</tr> 
							</thead>
							<tbody>
								<{if empty($list) == false}>
								<{foreach $list as $val}>
								<tr>
									<td><{$val.id}></td>
									<td><a class="xinsu-fontcolor-blue xinsu-user" href="javascript:;" data="<{$val.uid}>"><{$val.username}></a></td>
									<td><{$val["addtime"]}></td>
									<td><{if $val.status == 1}><{$val["uptime"]}><{/if}></td>
									<td class="xinsu-fontcolor-green"><{$val.money}></td>
									<{if $val.status == 0}>
									<td class="xinsu-fontcolor-blue">正常</td>
									<{else}>
									<td class="xinsu-fontcolor-green">已撤销</td>
									<{/if}>
									<td>
										<{if $val.status == 0}>
										<a class="xinsu-atm-pay xinsu-fontcolor-green xinsu-cancel"  href="javascript:;" data="<{$val.id}>" data-status="1">强制撤销</a>
										<{else}>
										--
										<{/if}>
									</td>
								</tr>
								<{/foreach}>
								<{else}>
								<tr>
									<td colspan="7">暂无数据</td>
								</tr>
								<{/if}>
							</tbody>
						</table>
					</div>
					<div class="xinsu-page">
						<div class="xinsu-show">
							<{$page}>
						</div>
						<div class="xinsu-clear"></div>
					</div>
				</div>
			</div>
		</div>
		<script>
			$(".xinsu-cancel").click(function (){
				var id = $(this).attr("data");
				var url = "/<{$common_info.controller}>/charge_cancel/" + id;
				layer.confirm('您确定要强制撤销，可能会造成资金负数？', {icon: 3}, function () {
					layer.closeAll();
					http_request_post(url, {status:2, token:token}, function (result) {
						if (result.status == 1) {
							layer.msg(result.msg, {icon: 1, time: 800}, function () {
									//跳转到登录页面
									location.reload();
								});
						} else {
							layer.msg(result.msg);
						}
					});
				});
			})			
		</script>
<{include file="public/footer.html"}>